//
//  SCCarAddImageItemCell.m
//  Shuaiche
//
//  Created by dangshuai on 2019/4/23.
//  Copyright © 2019 zzs. All rights reserved.
//

#import "SCCarAddImageItemCell.h"

@implementation SCCarAddImageItemCell

- (void)awakeFromNib {
    [super awakeFromNib];
    self.imageView.layer.cornerRadius = 4;
    self.imageView.layer.masksToBounds = YES;
    self.deleteBtn.hidden = YES;
    
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    UIBezierPath *bezierPath = [UIBezierPath bezierPathWithRoundedRect:self.mainPicTag.bounds byRoundingCorners:UIRectCornerBottomLeft | UIRectCornerBottomRight cornerRadii:CGSizeMake(4, 4)];
    CAShapeLayer *shapeLayer = [CAShapeLayer layer];
    shapeLayer.frame = self.mainPicTag.bounds;
    shapeLayer.path = bezierPath.CGPath;
    self.mainPicTag.layer.mask = shapeLayer;
}

- (IBAction)deletePicAction:(id)sender {
    if (self.delegate && [self.delegate respondsToSelector:@selector(SCCarAddImageItemCellDidDeletePic:)]) {
        [self.delegate SCCarAddImageItemCellDidDeletePic:self];
    }
}

@end
